package com.snack.shop.controller;

import com.snack.shop.common.Result;
import com.snack.shop.entity.PickupCategory;
import com.snack.shop.service.PickupCategoryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 代取分类控制器
 */
@Tag(name = "代取分类管理")
@RestController
@RequestMapping("/pickup/category")
@RequiredArgsConstructor
public class PickupCategoryController {

    private final PickupCategoryService pickupCategoryService;

    @Operation(summary = "获取代取分类列表")
    @GetMapping("/list")
    public Result<List<PickupCategory>> list() {
        List<PickupCategory> list = pickupCategoryService.getEnabledList();
        return Result.success(list);
    }
}

